#!/bin/bash --login

PATH=/bin:/usr/bin:/sbin:/usr/sbin:.
export PATH
HOME=/root
export HOME

/bin/echo "doing /init ...."
/bin/hostname nemonico

setlogcons 12

# Mount 
/bin/mount -v proc /proc -n -t proc
/bin/mount -v sysfs /sys -n -t sysfs
#/bin/mount -t tmpfs -o size=64M  mdev /dev
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts

# mdev
 echo "/bin/mdev" > /proc/sys/kernel/hotplug
/sbin/mdev -s 

ln -s /proc/mounts /etc/mtab

# hotplugs
#/etc/rc.d/rc.usb start
#/etc/rc.d/rc.ieee1394 start
test -x /sbin/ldconfig && /sbin/ldconfig

. /etc/scripts/env
. /etc/scripts/common.fn
. /etc/scripts/common.disks.fn

mount_media && /etc/scripts/make-kernel-links.sh

# rng-tools
if [ -c /dev/hwrandom ]; then
	_msg "Starting rngd"
	/usr/local/sbin/rngd
fi

# installation start time
date > $install_start_time

# fancy font
if [ -f /nemonico/files/misc/ter-k14n.psf -a ! "`grep nofancyfont /proc/cmdline 2>/dev/null`" ]; then
	loadfont < /nemonico/files/misc/ter-k14n.psf
fi

if [ "`grep autoinstall /proc/cmdline`" ]; then
	export interactive_session=0
	. /etc/scripts/autoinstall.fn
	autoinstall
else
	export interactive_session=1
	while true; do
		/usr/bin/screen -S `hostname` -t `hostname`
	done
fi

# vim: ts=2 syn=sh
# /init end
